<?php echo $this->render('frontend_common/header.phtml'); ?>
<?php $this->headLink()->appendStylesheet($this->baseUrl('css/admintable.css')); ?>
<?php $list=$this->listmaterial;?>
<div id="Content">
<div style="margin: auto; width: 50%; margin-top: 30px; margin-bottom: 30px">
<div><a style="border: 1px solid red; background-color: white; border-radius:5px 5px 5px; padding:5px ;font-weight: bold;color: black;text-decoration: none " href="<?php echo $this->baseUrl('admin/addmaterial') ?>">Thêm một hoa mới</a></div>
<table style="margin-top: 20px">
	<tr>
		<thead>
		<th>ID</th>
		<th>Tên hoa</th>
		<th>Đơn giá</th>
		<th></th>
		</thead>
	</tr>
	<?php foreach ($list as $key=>$mothoa){ ?>
		<tr
		<?php
			if ($key % 2 != 0)
				echo ('class="changecolor1" style="background-color:#f3f3f3;"');
			else
				echo ('class="changecolor2" style="background-color:#FFF;"');
		?>>
			<td><?php echo $mothoa['id'] ?></td>
			<td><?php echo $mothoa['tenhoa'] ?></td>
			<td><?php echo $mothoa['dongia'] ?></td>
			<td>
				<a href="<?php echo $this->url(array('controller'=>'admin','action'=>'editmaterial','hoa_id'=>$mothoa['id'])) ?>">
					<img title="Sửa thông tin" class="tool_img" src="<?php echo $this->baseUrl("images/system/changeicon.png") ?>" />
				</a>
				<a href="<?php echo $this->url(array('controller'=>'admin','action'=>'deletematerial','hoa_id'=>$mothoa['id'])) ?>">
					<img title="Xóa" class="tool_img" src="<?php echo $this->baseUrl("images/system/deleteicon.jpg") ?>" />
				</a>
			</td>
		</tr>
	<?php }?>
</table>
<a style="border: 1px solid red; background-color: white; border-radius:5px 5px 5px; padding:5px ;font-weight: bold;color: black;text-decoration: none; margin-top: 30px; float: left;margin-bottom: 30px " href="<?php echo $this->baseUrl('admin/index') ?>">Admin page</a>
<?php echo $this->render('frontend_common/footer.phtml'); ?>